<form class="form-inline">
    <div class="form-group">
        <input type="text" class="form-control" placeholder="点此输入关键字段">
    </div>
    <button type="submit" class="btn btn-default informationSearchBtn">查询</button>
    <div class="form-group">
        <input type="text" class="form-control" placeholder="客户渠道" list="selectProduct">
        <datalist id="selectProduct">
            <option>社交媒体</option>
            <option>市场活动</option>
            <option>国内展会</option>
            <option>国外展会</option>
            <option>国内电商</option>
            <option>国外电商</option>
            <option>其它渠道</option>
        </datalist>
    </div>
    <div class="form-group">
        <!-- <datepicker ng-model="dt" min-date="minDate" show-weeks="true" class="wellwell-sm"></datepicker> -->
        <p class="input-group informationDatePicker">
            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" min-date="2000-1-1" max-date="'2099-12-30'" datepicker-options="dateOptions" date-disabled="disabled(date,mode)" ng-required="true" close-text="Close">
            <span class="input-group-btn">
				<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
			</span>
        </p>
    </div>
    <div class="form-group">
        <input type="text" class="form-control" placeholder="录入部门" list="selectSection">
        <datalist id="selectSection">
            <option>管理</option>
            <option>销售一组</option>
            <option>销售二组</option>
            <option>市场部</option>
            <option>网络营销部</option>
            <option>创意部</option>
            <option>供应链</option>
            <option>财务部</option>
            <option>人力资源部</option>
            <option>物流部</option>
            <option>项目申报组</option>
        </datalist>
    </div>
</form>
<table class="table table-hover">
    <thead>
        <tr>
            <th>编号</th>
            <th>客户信息</th>
            <th>联系方式</th>
            <th>操作信息</th>
            <th>客户渠道</th>
            <th>购买总价</th>
            <th>交易次数</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="customer in customers">
            <td ng-bind="customer.id"></td>
            <td>
                <p>姓名：{{ customer.name }}</p>
                <p>大洲：{{ customer.continent }}</p>
                <p>国籍：{{ customer.country }}</p>
            </td>
            <td>
                <p>邮箱：{{ customer.email }}</p>
                <p>电话：{{ customer.phone }}</p>
                <p>地址：{{ customer.address }}</p>
            </td>
            <td>
                <p>录入：{{ customer.person }}（{{ customer.department }}）</p>
                <p>推荐：{{ customer.recommended }}</p>
                <p>日期：{{ customer.input_date }}</p>
            </td>
            <td ng-bind="customer.source"></td>
            <td>{{ customer.total_price | currency:'&yen;' }}</td>
            <td>交易{{ customer.status }}次</td>
            <td ng-bind="customer.remarks"></td>
            <td>
                <p><a href="" ng-click="editInformation(customer)">编辑客户信息</a></p>
                <p><a href="" ng-click="shoppingList(customer.id)">查看购买记录</a></p>
            </td>
        </tr>
    </tbody>
</table>


<!-- 购买记录 -->
<script type="text/ng-template" id="shoppingList.html">
    <h2>购买记录</h2>
    <dl ng-repeat="shopping_list in shopping_lists">
        <dt ng-repeat="item in shopping_list.item_list"><span>商品名：{{ item.item_name }}</span><span>价格：{{ item.item_price | currency:'&yen;' }}</span><span>产品编号：{{ item.item_number }}</span></dt>
        <dd ng-bind="shopping_list.shopping_source"></dd>
        <dd ng-bind="shopping_list.shopping_date"></dd>
    </dl>
</script>

<!-- 修改客户信息 -->
<script type="text/ng-template" id="editInformation.html">
    <h2>修改客户信息</h2>
    <form class="form-horizontal">
        <div class="form-group">
            <label for="editCustomerName" class="col-sm-2 control-label">姓名：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerName" ng-model="editCustomerName" placeholder="请输入客户姓名">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerEmail" class="col-sm-2 control-label">邮箱：</label>
            <div class="col-sm-10">
                <input type="email" class="form-control" id="editCustomerEmail" ng-model="editCustomerEmail" placeholder="请输入客户邮箱">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerPhone" class="col-sm-2 control-label">电话：</label>
            <div class="col-sm-10">
                <input type="tel" class="form-control" id="editCustomerPhone" ng-model="editCustomerPhone" placeholder="请输入客户电话">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerAddress" class="col-sm-2 control-label">地址：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerAddress" ng-model="editCustomerAddress" placeholder="请输入客户地址">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerDepartment" class="col-sm-2 control-label">录入部门：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerDepartment" ng-model="editCustomerDepartment" list="editCustomerDepartmentOption" placeholder="录入部门">
                <datalist id="editCustomerDepartmentOption">
                    <option>管理</option>
                    <option>销售一组</option>
                    <option>销售二组</option>
                    <option>市场部</option>
                    <option>网络营销部</option>
                    <option>创意部</option>
                    <option>供应链</option>
                    <option>财务部</option>
                    <option>人力资源部</option>
                    <option>物流部</option>
                    <option>项目申报组</option>
                </datalist>
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerPerson" class="col-sm-2 control-label">录入人：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerPerson" ng-model="editCustomerPerson" placeholder="请输入录入人">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerRecommended" class="col-sm-2 control-label">推荐人：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerRecommended" ng-model="editCustomerRecommended" placeholder="请输入推荐人">
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerSource" class="col-sm-2 control-label">客户渠道：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerSource" ng-model="editCustomerSource" list="editCustomerSourceOption" placeholder="客户渠道">
                <datalist id="editCustomerSourceOption">
                    <option>社交媒体</option>
                    <option>市场活动</option>
                    <option>国内展会</option>
                    <option>国外展会</option>
                    <option>国内电商</option>
                    <option>国外电商</option>
                    <option>其它渠道</option>
                </datalist>
            </div>
        </div>
        <div class="form-group">
            <label for="editCustomerRemarks" class="col-sm-2 control-label">备注：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="editCustomerRemarks" ng-model="editCustomerRemarks" placeholder="请输入备注">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default" ng-click="editCustomer()">保存</button>
            </div>
        </div>
    </form>
</script>
